import request from '@/utils/request'

/**
 * 登录接口方法
 * @param {*} data { account: 账号名, password: 密码 }
 * @returns Promise对象
 */
export const loginAPI = data => request({
  url: '/login',
  method: 'POST',
  data
})
// 获取-短信验证码
export const getCodeAPI = ({ mobile }) => {
  return request({
    url: '/login/code',
    params: {
      mobile
    }
  })
}

// 登录-手机验证码
export const loginByCodeAPI = ({ mobile, code }) => {
  return request({
    url: '/login/code',
    method: 'POST',
    data: {
      mobile,
      code
    }
  })
}
